﻿Imports System
Imports System.IO
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters.Binary
''' <summary>
''' 计算结果按时间分类
''' </summary>
''' <remarks></remarks>
<Serializable()> Public Class RectableAerageingTime
    Private m_NameAndData(-1) As NameAndData '用于储存计算结果。按最高值从高到低

    ''' <summary>
    ''' 用于储存不同平均时间的不同最大值的结果文件的名称和内容字符串
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property NameAndData() As NameAndData()
        Get
            Return Me.m_NameAndData
        End Get
        Set(ByVal value As NameAndData())
            Me.m_NameAndData = value
        End Set
    End Property

    ''' <summary>
    ''' 从AERMOD.OUT文件中获取相应的数据
    ''' </summary>
    ''' <param name="strAERMODOUT">输出文件内容的数组</param>
    ''' <param name="Receptor">接受点</param>
    ''' <param name="IsDep">沉降</param>
    ''' <param name="strAerageTime">平均时间</param>
    ''' <param name="strGroup">组</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function GetDataFromAERMODOUT(ByVal strAERMODOUT As String(), ByVal Receptor As Receptor, ByVal IsDep As Boolean, ByVal strAerageTime As String, ByVal MaxCon As Integer, ByVal strGroup As String, ByVal GroupSourceCount As Integer, ByVal version As String) As Boolean
        ReDim Me.m_NameAndData(MaxCon)
        For i As Integer = 0 To MaxCon '前nMax大的结果储存
            Me.m_NameAndData(i) = New NameAndData
            Select Case i
                Case 0
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "1ST", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 1
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "2ND", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 2
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "3RD", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 3
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "4TH", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 4
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "5TH", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 5
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "6TH", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 6
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "7TH", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 7
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "8TH", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 8
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "9TH", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
                Case 9
                    If m_NameAndData(i).GetDataFromAERMODOUT(strAERMODOUT, Receptor, IsDep, strAerageTime, "10TH", strGroup, GroupSourceCount, version) = False Then
                        Return False
                    End If
            End Select
        Next
        Return True
    End Function


End Class
